﻿<?xml version="1.0" encoding="utf-8" ?>
<root>
  <ningde>
    <device>
      <create>
        CREATE TABLE report.t_device(
        MOINSTID INT,
        DEVICENAME VARCHAR(40),
        TYPE VARCHAR(40),
        OBJECT VARCHAR(50),
        INSTNAME VARCHAR(100),
        CreateTime DATETIME )
      </create>
      <delete>
          delete from t_device
        </delete>
      <load>
        insert into t_device
        select MOINSTID,DEVICENAME,'中间件' type,'websphere' object,INSTNAME,getdate() as CreateTime
        from dba._PATROL__PMW_MAIN_PMW_NODE_PMW_APPSERVER_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'windows' object,INSTNAME,getdate() as CreateTime
        from dba._PATROL__NT_OS_NT_CPU_CONTAINER_NT_CPU_CFG_VIEW where instname='_Total'
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'windows' object,INSTNAME,getdate() as CreateTime
        from dba._PATROL__NT_OS_NT_MEMORY_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'windows' object,INSTNAME,getdate() as CreateTime
        from dba._PATROL__NT_OS_NT_LOGICAL_DISKS_CONTAINER_NT_LOGICAL_DISKS_CFG_VIEW where instname not like '_Total'
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'windows' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_WINDOWSWINDOWS_OS_WINDOWS_2000_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'windows' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_WINDOWSWINDOWS_OS_WINDOWS_2003_CFG_VIEW
        union all
		    select MOINSTID,DEVICENAME,'服务器' type,'windows' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_OWS_OS_DATA_STORAGE_GENERIC_WINDOWS_OS_LOGICAL_DISKS_GENERIC_WINDOWS_OS_LOGICAL_DISK_GENERIC_CFG_VIEW
		    union all
        select MOINSTID,DEVICENAME,'服务器' type,'linux' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_LINUX_CMDSHELL_BASE_DR2AL_LINUX_CMDSHELL_CPU_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'linux' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_LINUX_CMDSHELL_BASE_DR2AL_LINUX_CMDSHELL_MEMORY_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'linux' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_CMDSHELL_DATASTORAGE_CONTAINER_DR2AL_CMDSHELL_FILESYSTEM_CONTAINER_DR2AL_CMDSHELL_FILESYSTEM2_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'linux' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_LINUX_CMDSHELL_BASE_DR2AL_LINUX_CMDSHELL_SWAP_CFG_VIEW
        union all		
        select MOINSTID,DEVICENAME,'服务器' type,'unix' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_HPUX_CMDSHELL_BASE_DR2AL_HPUX_CMDSHELL_CPU_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'unix' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_HPUX_CMDSHELL_BASE_DR2AL_HPUX_CMDSHELL_MEMORY_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'unix' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_CMDSHELL_DATASTORAGE_CONTAINER_DR2AL_CMDSHELL_FILESYSTEM_CONTAINER_DR2AL_CMDSHELL_FILESYSTEM4_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'unix' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_HPUX_CMDSHELL_BASE_DR2AL_HPUX_CMDSHELL_SWAP_CFG_VIEW
      </load>
      </device>
    <performance>
      <create>
        CREATE TABLE report.t_performance (
        ID numeric(15,0) IDENTITY,
        DeviceId INT,
        IP VARCHAR(40),
        Parameter VARCHAR(40),
        ParameterDisplay VARCHAR(1000),
        value VARCHAR(100),
        Timestamp DATETIME,
        FromTime VARCHAR(40),
        Totime VARCHAR(40) )
      </create>
      <load>
        <p>
          select a.moinstid, b.devicename,'APPSERVERAVAILABILITY' Parameter,'was中间件连接状态' ParameterDisplay, (1-round(sum(APPSERVERAVAILABILITY_AVG)/count(*),3))*100 as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._PATROL__PMW_MAIN_PMW_NODE_PMW_APPSERVER_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and APPSERVERAVAILABILITY_AVG!=-2.147483648E7
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'CPUPRCRPROCESSORTIMEPERCENT' Parameter,'Windows CPU使用率' ParameterDisplay, round(avg(CPUPRCRPROCESSORTIMEPERCENT_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._PATROL__NT_OS_NT_CPU_CONTAINER_NT_CPU_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and CPUPRCRPROCESSORTIMEPERCENT_AVG!=-2.147483648E7  and b.instname='_Total'
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'MEMMEMAVAILABLEBYTES' Parameter,'Windows 剩余内存' ParameterDisplay, round(avg(MEMMEMAVAILABLEBYTES_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._PATROL__NT_OS_NT_MEMORY_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and MEMMEMAVAILABLEBYTES_AVG!=-2.147483648E7
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'LDLDFREESPACEPERCENT' Parameter,'Windows 逻辑磁盘剩余率' ParameterDisplay, round(avg(LDLDFREESPACEPERCENT_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._PATROL__NT_OS_NT_LOGICAL_DISKS_CONTAINER_NT_LOGICAL_DISKS_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and LDLDFREESPACEPERCENT_AVG!=-2.147483648E7 and b.instname='Logical Disk (C:)'
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'MEMORYAVAILABLE' Parameter,'Windows 剩余内存' ParameterDisplay, round(avg(a.MEMORYAVAILABLE_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_WINDOWSWINDOWS_OS_WINDOWS_2000_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and MEMORYAVAILABLE_AVG!=-2.147483648E7
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'CPUTOTALUTILIZATION' Parameter,'Windows CPU使用率' ParameterDisplay, round(avg(a.CPUTOTALUTILIZATION_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_WINDOWSWINDOWS_OS_WINDOWS_2000_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and CPUTOTALUTILIZATION_AVG!=-2.147483648E7
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'MEMORYAVAILABLE' Parameter,'Windows 剩余内存' ParameterDisplay, round(avg(a.MEMORYAVAILABLE_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_WINDOWSWINDOWS_OS_WINDOWS_2003_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and MEMORYAVAILABLE_AVG!=-2.147483648E7
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'CPUTOTALUTILIZATION' Parameter,'Windows CPU使用率' ParameterDisplay, round(avg(a.CPUTOTALUTILIZATION_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_WINDOWSWINDOWS_OS_WINDOWS_2003_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and CPUTOTALUTILIZATION_AVG!=-2.147483648E7
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'DISKFREESPACE' Parameter,'Windows 逻辑磁盘剩余率' ParameterDisplay, round(avg(a.DISKFREESPACE_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._BPM_OWS_OS_DATA_STORAGE_GENERIC_WINDOWS_OS_LOGICAL_DISKS_GENERIC_WINDOWS_OS_LOGICAL_DISK_GENERIC_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and DISKFREESPACE_AVG!=-2.147483648E7
          group by a.moinstid,b.devicename
        </p>
        	    <p>
          select a.moinstid, b.devicename,'MEMORYUTILIZATION_AVG' Parameter,'Windows2000 内存使用率' ParameterDisplay, round(avg(a.MEMORYUTILIZATION_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_WINDOWSWINDOWS_OS_WINDOWS_2000_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and MEMORYUTILIZATION_AVG!=-2147483646 and MEMORYUTILIZATION_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'CPUTOTALUTILIZATION_AVG' Parameter,'Windows2000 CPU使用率' ParameterDisplay, round(avg(a.CPUTOTALUTILIZATION_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_WINDOWSWINDOWS_OS_WINDOWS_2000_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and CPUTOTALUTILIZATION_AVG!=-2147483646 and CPUTOTALUTILIZATION_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
		<p>
          select a.moinstid, b.devicename,'MEMORYUTILIZATION_AVG' Parameter,'Windows2003 内存使用率' ParameterDisplay, round(avg(a.MEMORYUTILIZATION_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_WINDOWSWINDOWS_OS_WINDOWS_2003_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and MEMORYUTILIZATION_AVG!=-2.147483648E7
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'CPUTOTALUTILIZATION_AVG' Parameter,'Windows2003 CPU使用率' ParameterDisplay, round(avg(a.CPUTOTALUTILIZATION_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_WINDOWSWINDOWS_OS_WINDOWS_2003_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and CPUTOTALUTILIZATION_AVG!=-2.147483648E7
          group by a.moinstid,b.devicename
        </p>
		    <p>
          select a.moinstid, b.devicename,'DISKFREESPACE_AVG' Parameter,'Windows2003 逻辑磁盘剩余率' ParameterDisplay, round(avg(a.DISKFREESPACE_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._BPM_OWS_OS_DATA_STORAGE_GENERIC_WINDOWS_OS_LOGICAL_DISKS_GENERIC_WINDOWS_OS_LOGICAL_DISK_GENERIC_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and DISKFREESPACE_AVG!=-2147483646 and DISKFREESPACE_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'PATSDK_COMMANDSHELL_LINUX_CPU_USAGE' Parameter,'Linux CPU使用率' ParameterDisplay, round(avg(a.PATSDK_COMMANDSHELL_LINUX_CPU_USAGE_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_LINUX_CMDSHELL_BASE_DR2AL_LINUX_CMDSHELL_CPU_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID and PATSDK_COMMANDSHELL_LINUX_CPU_USAGE_AVG!=-2147483646 and PATSDK_COMMANDSHELL_LINUX_CPU_USAGE_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'PATSDK_COMMANDSHELL_LINUX_FREE_MEMORY_PERCENT' Parameter,'Linux 剩余内存' ParameterDisplay, round(avg(a.PATSDK_COMMANDSHELL_LINUX_FREE_MEMORY_PERCENT_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime
          from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_LINUX_CMDSHELL_BASE_DR2AL_LINUX_CMDSHELL_MEMORY_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID and PATSDK_COMMANDSHELL_LINUX_FREE_MEMORY_PERCENT_AVG!=-2147483646 and PATSDK_COMMANDSHELL_LINUX_FREE_MEMORY_PERCENT_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'PATSDK_COMMANDSHELL_FILESYSTEM_UTILIZATION' Parameter,'Linux 文件系统使用率' ParameterDisplay, round(avg(a.PATSDK_COMMANDSHELL_FILESYSTEM_UTILIZATION_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime
          from dba._BPM_CMDSHELL_DATASTORAGE_CONTAINER_DR2AL_CMDSHELL_FILESYSTEM_CONTAINER_DR2AL_CMDSHELL_FILESYSTEM2_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'PATSDK_COMMANDSHELL_LINUX_SWAP_FREE_SPACE_PERCENT' Parameter,'Linux 交换剩余率' ParameterDisplay, round(avg(a.PATSDK_COMMANDSHELL_LINUX_SWAP_FREE_SPACE_PERCENT_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime
          from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_LINUX_CMDSHELL_BASE_DR2AL_LINUX_CMDSHELL_SWAP_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID and PATSDK_COMMANDSHELL_LINUX_SWAP_FREE_SPACE_PERCENT_AVG!=-2147483646 and PATSDK_COMMANDSHELL_LINUX_SWAP_FREE_SPACE_PERCENT_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'PATSDK_COMMANDSHELL_HPUX_CPU_USAGE' Parameter,'Unix CPU使用率' ParameterDisplay, round(avg(a.PATSDK_COMMANDSHELL_HPUX_CPU_USAGE_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime
          from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_HPUX_CMDSHELL_BASE_DR2AL_HPUX_CMDSHELL_CPU_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID and PATSDK_COMMANDSHELL_HPUX_CPU_USAGE_AVG!=-2147483646 and PATSDK_COMMANDSHELL_HPUX_CPU_USAGE_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'PATSDK_COMMANDSHELL_HPUX_FREE_MEMORY_PERCENT' Parameter,'Unix 剩余内存' ParameterDisplay, round(avg(a.PATSDK_COMMANDSHELL_HPUX_FREE_MEMORY_PERCENT_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime
          from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_HPUX_CMDSHELL_BASE_DR2AL_HPUX_CMDSHELL_MEMORY_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID and PATSDK_COMMANDSHELL_HPUX_FREE_MEMORY_PERCENT_AVG!=-2147483646 and PATSDK_COMMANDSHELL_HPUX_FREE_MEMORY_PERCENT_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'PATSDK_COMMANDSHELL_FILESYSTEM_UTILIZATION' Parameter,'Unix 文件系统使用率' ParameterDisplay, round(avg(a.PATSDK_COMMANDSHELL_FILESYSTEM_UTILIZATION_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime
          from dba._BPM_CMDSHELL_DATASTORAGE_CONTAINER_DR2AL_CMDSHELL_FILESYSTEM_CONTAINER_DR2AL_CMDSHELL_FILESYSTEM4_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID and PATSDK_COMMANDSHELL_FILESYSTEM_UTILIZATION_AVG!=-2.147483648E7
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'PATSDK_COMMANDSHELL_HPUX_SWAP_FREE_SPACE_PERCENT' Parameter,'Unix 交换剩余率' ParameterDisplay, round(avg(a.PATSDK_COMMANDSHELL_HPUX_SWAP_FREE_SPACE_PERCENT_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime
          from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_HPUX_CMDSHELL_BASE_DR2AL_HPUX_CMDSHELL_SWAP_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID and PATSDK_COMMANDSHELL_HPUX_SWAP_FREE_SPACE_PERCENT_AVG!=-2147483646 and PATSDK_COMMANDSHELL_HPUX_SWAP_FREE_SPACE_PERCENT_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
      </load>
      </performance>
    <tmartavai>
      <create>
	  CREATE TABLE report.t_tmartAvailability 
      (PROJECT_NAME VARCHAR(260),
      MOINSTID INT,
      VALUE INT,
      CreateTime DATETIME,
      FromTime VARCHAR(40),
      Totime VARCHAR(40))
    </create>
      <load>
        insert into report.t_TmartAvailability (PROJECT_NAME,MOINSTID,Value,CreateTime,FROMTIME,TOTIME)
        select a.PROJECT_NAME,a.MOINSTID,round(avg(b.STATS_AVAILABILITY_AVG),3) as value,getdate() as CreateTime, 
        :fromTime as fromtime,:toTime as totime 
        from dba.TMARTTRANSACTIONS_CFG_VIEW a,dba.TMARTTRANSACTIONS_RT_VIEW b with(NOLOCK) 
        where b.fromtime>=:fromTime and b.totime &lt;=:toTime and a.MOINSTID=b.MOINSTID and STATS_AVAILABILITY_AVG  > 0
        group by a.PROJECT_NAME,a.MOINSTID
      </load>
    </tmartavai>
  </ningde>
  <sanming>
    <device>
     <create>
        CREATE TABLE report.t_device(
        MOINSTID INT,
        DEVICENAME VARCHAR(40),
        TYPE VARCHAR(40),
        OBJECT VARCHAR(50),
        INSTNAME VARCHAR(100),
        CreateTime DATETIME )
      </create>
     <delete>
      delete from t_device
    </delete>
      <load>
        insert into t_device
        select MOINSTID,DEVICENAME,'中间件' type,'websphere' object,INSTNAME,getdate() as CreateTime
        from dba._PATROL__PMW_MAIN_PMW_NODE_PMW_APPSERVER_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'windows' object,INSTNAME,getdate() as CreateTime
        from dba._PATROL__NT_OS_NT_CPU_CONTAINER_NT_CPU_CFG_VIEW where instname='_Total'
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'windows' object,INSTNAME,getdate() as CreateTime
        from dba._PATROL__NT_OS_NT_MEMORY_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'windows' object,INSTNAME,getdate() as CreateTime
        from dba._PATROL__NT_OS_NT_LOGICAL_DISKS_CONTAINER_NT_LOGICAL_DISKS_CFG_VIEW where instname not like '_Total'
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'windows' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_WINDOWSWINDOWS_OS_WINDOWS_2000_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'windows' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_WINDOWSWINDOWS_OS_WINDOWS_2003_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'windows' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_OWS_OS_DATA_STORAGE_GENERIC_WINDOWS_OS_LOGICAL_DISKS_GENERIC_WINDOWS_OS_LOGICAL_DISK_GENERIC_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'linux' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_LINUX_CMDSHELL_BASE_DR2AL_LINUX_CMDSHELL_CPU_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'linux' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_LINUX_CMDSHELL_BASE_DR2AL_LINUX_CMDSHELL_MEMORY_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'linux' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_CMDSHELL_DATASTORAGE_CONTAINER_DR2AL_CMDSHELL_FILESYSTEM_CONTAINER_DR2AL_CMDSHELL_FILESYSTEM2_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'linux' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_LINUX_CMDSHELL_BASE_DR2AL_LINUX_CMDSHELL_SWAP_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'unix' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_HPUX_CMDSHELL_BASE_DR2AL_HPUX_CMDSHELL_CPU_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'unix' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_HPUX_CMDSHELL_BASE_DR2AL_HPUX_CMDSHELL_MEMORY_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'unix' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_CMDSHELL_DATASTORAGE_CONTAINER_DR2AL_CMDSHELL_FILESYSTEM_CONTAINER_DR2AL_CMDSHELL_FILESYSTEM4_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'unix' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_HPUX_CMDSHELL_BASE_DR2AL_HPUX_CMDSHELL_SWAP_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'AIX' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_AIX_CMDSHELL_BASE_DR2AL_AIX_CMDSHELL_CPU_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'AIX' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_AIX_CMDSHELL_BASE_DR2AL_AIX_CMDSHELL_MEMORY_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'AIX' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_CMDSHELL_DATASTORAGE_CONTAINER_DR2AL_CMDSHELL_FILESYSTEM_CONTAINER_DR2AL_CMDSHELL_FILESYSTEM_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'AIX' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_AIX_CMDSHELL_BASE_DR2AL_AIX_CMDSHELL_SWAP_CFG_VIEW

      </load>
      </device>
    <performance>
      <create>
        CREATE TABLE report.t_performance (
        ID numeric(15,0) IDENTITY,
        DeviceId INT,
        IP VARCHAR(40),
        Parameter VARCHAR(40),
        ParameterDisplay VARCHAR(1000),
        value VARCHAR(100),
        Timestamp DATETIME,
        FromTime VARCHAR(40),
        Totime VARCHAR(40) )
      </create>
      <load>
        <p>
          select a.moinstid, b.devicename,'APPSERVERAVAILABILITY' Parameter,'was中间件连接状态' ParameterDisplay, (1-round(sum(APPSERVERAVAILABILITY_AVG)/count(*),3))*100 as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._PATROL__PMW_MAIN_PMW_NODE_PMW_APPSERVER_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and APPSERVERAVAILABILITY_AVG!=-2.147483648E7
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'CPUPRCRPROCESSORTIMEPERCENT' Parameter,'Windows CPU使用率' ParameterDisplay, round(avg(CPUPRCRPROCESSORTIMEPERCENT_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._PATROL__NT_OS_NT_CPU_CONTAINER_NT_CPU_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and CPUPRCRPROCESSORTIMEPERCENT_AVG!=-2.147483648E7  and b.instname='_Total'
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'MEMMEMAVAILABLEBYTES' Parameter,'Windows 剩余内存' ParameterDisplay, round(avg(MEMMEMAVAILABLEBYTES_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._PATROL__NT_OS_NT_MEMORY_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and MEMMEMAVAILABLEBYTES_AVG!=-2.147483648E7
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'LDLDFREESPACEPERCENT' Parameter,'Windows 逻辑磁盘剩余率' ParameterDisplay, round(avg(LDLDFREESPACEPERCENT_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._PATROL__NT_OS_NT_LOGICAL_DISKS_CONTAINER_NT_LOGICAL_DISKS_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and LDLDFREESPACEPERCENT_AVG!=-2.147483648E7 and b.instname='Logical Disk (C:)'
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'MEMORYAVAILABLE' Parameter,'Windows 剩余内存' ParameterDisplay, round(avg(a.MEMORYAVAILABLE_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_WINDOWSWINDOWS_OS_WINDOWS_2000_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and MEMORYAVAILABLE_AVG!=-2147483646 and MEMORYAVAILABLE_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'CPUTOTALUTILIZATION' Parameter,'Windows CPU使用率' ParameterDisplay, round(avg(a.CPUTOTALUTILIZATION_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_WINDOWSWINDOWS_OS_WINDOWS_2000_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and CPUTOTALUTILIZATION_AVG!=-2147483646 and CPUTOTALUTILIZATION_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'MEMORYAVAILABLE' Parameter,'Windows 剩余内存' ParameterDisplay, round(avg(a.MEMORYAVAILABLE_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_WINDOWSWINDOWS_OS_WINDOWS_2003_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and MEMORYAVAILABLE_AVG!=-2.147483648E7
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'CPUTOTALUTILIZATION' Parameter,'Windows CPU使用率' ParameterDisplay, round(avg(a.CPUTOTALUTILIZATION_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_WINDOWSWINDOWS_OS_WINDOWS_2003_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and CPUTOTALUTILIZATION_AVG!=-2.147483648E7
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'DISKFREESPACE' Parameter,'Windows 逻辑磁盘剩余率' ParameterDisplay, round(avg(a.DISKFREESPACE_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._BPM_OWS_OS_DATA_STORAGE_GENERIC_WINDOWS_OS_LOGICAL_DISKS_GENERIC_WINDOWS_OS_LOGICAL_DISK_GENERIC_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and DISKFREESPACE_AVG!=-2.147483648E7
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'MEMORYUTILIZATION_AVG' Parameter,'Windows2000 内存使用率' ParameterDisplay, round(avg(a.MEMORYUTILIZATION_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_WINDOWSWINDOWS_OS_WINDOWS_2000_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and MEMORYUTILIZATION_AVG!=-2147483646 and MEMORYUTILIZATION_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'CPUTOTALUTILIZATION_AVG' Parameter,'Windows2000 CPU使用率' ParameterDisplay, round(avg(a.CPUTOTALUTILIZATION_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_WINDOWSWINDOWS_OS_WINDOWS_2000_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and CPUTOTALUTILIZATION_AVG!=-2147483646 and CPUTOTALUTILIZATION_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
		     <p>
          select a.moinstid, b.devicename,'MEMORYUTILIZATION_AVG' Parameter,'Windows2003 内存使用率' ParameterDisplay, round(avg(a.MEMORYUTILIZATION_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_WINDOWSWINDOWS_OS_WINDOWS_2003_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and MEMORYUTILIZATION_AVG!=-2.147483648E7
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'CPUTOTALUTILIZATION_AVG' Parameter,'Windows2003 CPU使用率' ParameterDisplay, round(avg(a.CPUTOTALUTILIZATION_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_WINDOWSWINDOWS_OS_WINDOWS_2003_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and CPUTOTALUTILIZATION_AVG!=-2.147483648E7
          group by a.moinstid,b.devicename
        </p>
		<p>
          select a.moinstid, b.devicename,'DISKFREESPACE_AVG' Parameter,'Windows2003 逻辑磁盘剩余率' ParameterDisplay, round(avg(a.DISKFREESPACE_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._BPM_OWS_OS_DATA_STORAGE_GENERIC_WINDOWS_OS_LOGICAL_DISKS_GENERIC_WINDOWS_OS_LOGICAL_DISK_GENERIC_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and DISKFREESPACE_AVG!=-2147483646 and DISKFREESPACE_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'PATSDK_COMMANDSHELL_LINUX_CPU_USAGE' Parameter,'Linux CPU使用率' ParameterDisplay, round(avg(a.PATSDK_COMMANDSHELL_LINUX_CPU_USAGE_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_LINUX_CMDSHELL_BASE_DR2AL_LINUX_CMDSHELL_CPU_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID and PATSDK_COMMANDSHELL_LINUX_CPU_USAGE_AVG!=-2147483646 and PATSDK_COMMANDSHELL_LINUX_CPU_USAGE_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'PATSDK_COMMANDSHELL_LINUX_FREE_MEMORY_PERCENT' Parameter,'Linux 剩余内存' ParameterDisplay, round(avg(a.PATSDK_COMMANDSHELL_LINUX_FREE_MEMORY_PERCENT_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime
          from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_LINUX_CMDSHELL_BASE_DR2AL_LINUX_CMDSHELL_MEMORY_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID and PATSDK_COMMANDSHELL_LINUX_FREE_MEMORY_PERCENT_AVG!=-2147483646 and PATSDK_COMMANDSHELL_LINUX_FREE_MEMORY_PERCENT_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'PATSDK_COMMANDSHELL_FILESYSTEM_UTILIZATION' Parameter,'Linux 文件系统使用率' ParameterDisplay, round(avg(a.PATSDK_COMMANDSHELL_FILESYSTEM_UTILIZATION_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime
          from dba._BPM_CMDSHELL_DATASTORAGE_CONTAINER_DR2AL_CMDSHELL_FILESYSTEM_CONTAINER_DR2AL_CMDSHELL_FILESYSTEM2_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'PATSDK_COMMANDSHELL_LINUX_SWAP_FREE_SPACE_PERCENT' Parameter,'Linux 交换剩余率' ParameterDisplay, round(avg(a.PATSDK_COMMANDSHELL_LINUX_SWAP_FREE_SPACE_PERCENT_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime
          from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_LINUX_CMDSHELL_BASE_DR2AL_LINUX_CMDSHELL_SWAP_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID and PATSDK_COMMANDSHELL_LINUX_SWAP_FREE_SPACE_PERCENT_AVG!=-2147483646 and PATSDK_COMMANDSHELL_LINUX_SWAP_FREE_SPACE_PERCENT_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'PATSDK_COMMANDSHELL_HPUX_CPU_USAGE' Parameter,'Unix CPU使用率' ParameterDisplay, round(avg(a.PATSDK_COMMANDSHELL_HPUX_CPU_USAGE_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime
          from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_HPUX_CMDSHELL_BASE_DR2AL_HPUX_CMDSHELL_CPU_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID and PATSDK_COMMANDSHELL_HPUX_CPU_USAGE_AVG!=-2147483646 and PATSDK_COMMANDSHELL_HPUX_CPU_USAGE_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'PATSDK_COMMANDSHELL_FILESYSTEM_UTILIZATION' Parameter,'Unix 文件系统使用率' ParameterDisplay, round(avg(a.PATSDK_COMMANDSHELL_FILESYSTEM_UTILIZATION_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime
          from dba._BPM_CMDSHELL_DATASTORAGE_CONTAINER_DR2AL_CMDSHELL_FILESYSTEM_CONTAINER_DR2AL_CMDSHELL_FILESYSTEM4_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID and PATSDK_COMMANDSHELL_FILESYSTEM_UTILIZATION_AVG!=-2.147483648E7
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'PATSDK_COMMANDSHELL_HPUX_SWAP_FREE_SPACE_PERCENT' Parameter,'Unix 交换剩余率' ParameterDisplay, round(avg(a.PATSDK_COMMANDSHELL_HPUX_SWAP_FREE_SPACE_PERCENT_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime
          from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_HPUX_CMDSHELL_BASE_DR2AL_HPUX_CMDSHELL_SWAP_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID and PATSDK_COMMANDSHELL_HPUX_SWAP_FREE_SPACE_PERCENT_AVG!=-2147483646 and PATSDK_COMMANDSHELL_HPUX_SWAP_FREE_SPACE_PERCENT_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'PATSDK_COMMANDSHELL_AIX_CPU_USAGE' Parameter,'AIX CPU使用率' ParameterDisplay, round(avg(a.PATSDK_COMMANDSHELL_AIX_CPU_USAGE_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime
          from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_AIX_CMDSHELL_BASE_DR2AL_AIX_CMDSHELL_CPU_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID and PATSDK_COMMANDSHELL_AIX_CPU_USAGE_AVG!=-2.147483648E7
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'PATSDK_COMMANDSHELL_AIX_FREE_MEMORY_PERCENT' Parameter,'AIX 剩余内存' ParameterDisplay, round(avg(a.PATSDK_COMMANDSHELL_AIX_FREE_MEMORY_PERCENT_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime
          from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_AIX_CMDSHELL_BASE_DR2AL_AIX_CMDSHELL_MEMORY_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID and PATSDK_COMMANDSHELL_AIX_FREE_MEMORY_PERCENT_AVG!=-2.147483648E7
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'PATSDK_COMMANDSHELL_FILESYSTEM_UTILIZATION' Parameter,'AIX 文件系统使用率' ParameterDisplay, round(avg(a.PATSDK_COMMANDSHELL_FILESYSTEM_UTILIZATION_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime
          from dba._BPM_CMDSHELL_DATASTORAGE_CONTAINER_DR2AL_CMDSHELL_FILESYSTEM_CONTAINER_DR2AL_CMDSHELL_FILESYSTEM_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID and PATSDK_COMMANDSHELL_FILESYSTEM_UTILIZATION_AVG!=-2147483646 and PATSDK_COMMANDSHELL_FILESYSTEM_UTILIZATION_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'PATSDK_COMMANDSHELL_AIX_SWAP_FREE_SPACE_PERCENT' Parameter,'AIX 交换剩余率' ParameterDisplay, round(avg(a.PATSDK_COMMANDSHELL_AIX_SWAP_FREE_SPACE_PERCENT_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime
          from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_AIX_CMDSHELL_BASE_DR2AL_AIX_CMDSHELL_SWAP_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID and PATSDK_COMMANDSHELL_AIX_SWAP_FREE_SPACE_PERCENT_AVG!=-2.147483648E7
          group by a.moinstid,b.devicename
        </p>
      </load>
      </performance>
    <tmartavai>
      <create>
        CREATE TABLE report.t_tmartAvailability
        (PROJECT_NAME VARCHAR(260),
        MOINSTID INT,
        VALUE INT,
        CreateTime DATETIME,
        FromTime VARCHAR(40),
        Totime VARCHAR(40))
      </create>
      <load>
        insert into report.t_TmartAvailability (PROJECT_NAME,MOINSTID,Value,CreateTime,FROMTIME,TOTIME)
        select a.PROJECT_NAME,a.MOINSTID,round(avg(b.STATS_AVAILABILITY_AVG),3) as value,getdate() as CreateTime,
        :fromTime as fromtime,:toTime as totime
        from dba.TMARTTRANSACTIONS_CFG_VIEW a,dba.TMARTTRANSACTIONS_RT_VIEW b with(NOLOCK)
        where b.fromtime>=:fromTime and b.totime &lt;=:toTime and a.MOINSTID=b.MOINSTID and STATS_AVAILABILITY_AVG  > 0
        group by a.PROJECT_NAME,a.MOINSTID
      </load>
    </tmartavai>
  </sanming>
  <sheng>
    <device>
      <create>
        CREATE TABLE report.t_device(
        MOINSTID INT,
        DEVICENAME VARCHAR(40),
        TYPE VARCHAR(40),
        OBJECT VARCHAR(50),
        INSTNAME VARCHAR(100),
        CreateTime DATETIME )
      </create>
      <delete>
      delete from t_device
    </delete>
      <load>
        insert into t_device
        select MOINSTID,DEVICENAME,'服务器' type,'windows' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_WINDOWSWINDOWS_OS_WINDOWS_2000_CFG_VIEW
        union all
		    select MOINSTID,DEVICENAME,'服务器' type,'windows' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_WINDOWSWINDOWS_OS_WINDOWS_2003_CFG_VIEW
        union all
		    select MOINSTID,DEVICENAME,'服务器' type,'windows' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_OWS_OS_DATA_STORAGE_GENERIC_WINDOWS_OS_LOGICAL_DISKS_GENERIC_WINDOWS_OS_LOGICAL_DISK_GENERIC_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'windows' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_WINDOWSWINDOWS_OS_WINDOWS_GENERIC_CFG_VIEW	
		    union all
        select MOINSTID,DEVICENAME,'服务器' type,'linux' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_LINUX_CMDSHELL_BASE_DR2AL_LINUX_CMDSHELL_CPU_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'linux' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_LINUX_CMDSHELL_BASE_DR2AL_LINUX_CMDSHELL_MEMORY_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'linux' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_CMDSHELL_DATASTORAGE_CONTAINER_DR2AL_CMDSHELL_FILESYSTEM_CONTAINER_DR2AL_CMDSHELL_FILESYSTEM2_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'linux' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_LINUX_CMDSHELL_BASE_DR2AL_LINUX_CMDSHELL_SWAP_CFG_VIEW
        union all		
        select MOINSTID,DEVICENAME,'服务器' type,'unix' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_HPUX_CMDSHELL_BASE_DR2AL_HPUX_CMDSHELL_CPU_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'unix' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_HPUX_CMDSHELL_BASE_DR2AL_HPUX_CMDSHELL_MEMORY_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'unix' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_CMDSHELL_DATASTORAGE_CONTAINER_DR2AL_CMDSHELL_FILESYSTEM_CONTAINER_DR2AL_CMDSHELL_FILESYSTEM4_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'unix' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_HPUX_CMDSHELL_BASE_DR2AL_HPUX_CMDSHELL_SWAP_CFG_VIEW
        union all		
        select MOINSTID,DEVICENAME,'服务器' type,'AIX' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_AIX_CMDSHELL_BASE_DR2AL_AIX_CMDSHELL_CPU_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'AIX' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_AIX_CMDSHELL_BASE_DR2AL_AIX_CMDSHELL_MEMORY_CFG_VIEW
        union all
        select MOINSTID,DEVICENAME,'服务器' type,'AIX' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_CMDSHELL_DATASTORAGE_CONTAINER_DR2AL_CMDSHELL_FILESYSTEM_CONTAINER_DR2AL_CMDSHELL_FILESYSTEM_CFG_VIEW
		    union all
        select MOINSTID,DEVICENAME,'服务器' type,'AIX' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_AIX_CMDSHELL_BASE_DR2AL_AIX_CMDSHELL_SWAP_CFG_VIEW
		    union all
		    select MOINSTID,DEVICENAME,'数据库' type,'DB2' object,INSTNAME,getdate() as CreateTime
        from dba._BPM__PM_EXPRESS_FOR_DATABASES_DB2_UDBCOM_BMC_DRPM4_CONTAINER_COM_BMC_DRPM4_INSTANCE_AVAILABILITY_CFG_VIEW
		    union all
	      select MOINSTID,DEVICENAME,'数据库' type,'DB2' object,INSTNAME,getdate() as CreateTime
        from dba._BPM__DRPM4_CONTAINER_COM_BMC_DRPM4_DATABASE_COM_BMC_DRPM4_DATABASEAPP_COM_BMC_DRPM4_AVAILABILITY_CFG_VIEW
		    union all
		    select MOINSTID,DEVICENAME,'数据库' type,'ORACLE' object,INSTNAME,getdate() as CreateTime
        from dba._BPM_BMC_PM_EXPRESS_FOR_DATABASES_ORACLECOM_BMC_DRPM3_CONTAINER_COM_BMC_DRPM3_AVAILABILITY_CFG_VIEW
      </load>
    </device>
    <performance>
      <create>
        CREATE TABLE report.t_performance (
        ID numeric(15,0) IDENTITY,
        DeviceId INT,
        IP VARCHAR(100),
        Parameter VARCHAR(100),
        ParameterDisplay VARCHAR(1000),
        value VARCHAR(100),
        Timestamp DATETIME,
        FromTime VARCHAR(40),
        Totime VARCHAR(40) )
      </create>
      <load>
	     <p>
          select a.moinstid, b.devicename,'MEMORYUTILIZATION_AVG' Parameter,'Windows2000 内存使用率' ParameterDisplay, round(avg(a.MEMORYUTILIZATION_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_WINDOWSWINDOWS_OS_WINDOWS_2000_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and MEMORYUTILIZATION_AVG!=-2147483646 and MEMORYUTILIZATION_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'CPUTOTALUTILIZATION_AVG' Parameter,'Windows2000 CPU使用率' ParameterDisplay, round(avg(a.CPUTOTALUTILIZATION_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_WINDOWSWINDOWS_OS_WINDOWS_2000_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and CPUTOTALUTILIZATION_AVG!=-2147483646 and CPUTOTALUTILIZATION_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
		    <p>
          select a.moinstid, b.devicename,'MEMORYUTILIZATION_AVG' Parameter,'Windows2003 内存使用率' ParameterDisplay, round(avg(a.MEMORYUTILIZATION_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_WINDOWSWINDOWS_OS_WINDOWS_2003_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and MEMORYUTILIZATION_AVG!=-2.147483648E7
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'CPUTOTALUTILIZATION_AVG' Parameter,'Windows2003 CPU使用率' ParameterDisplay, round(avg(a.CPUTOTALUTILIZATION_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_WINDOWSWINDOWS_OS_WINDOWS_2003_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and CPUTOTALUTILIZATION_AVG!=-2.147483648E7
          group by a.moinstid,b.devicename
        </p>
		     <p>
          select a.moinstid, b.devicename,'DISKFREESPACE_AVG' Parameter,'Windows2003 逻辑磁盘剩余率' ParameterDisplay, round(avg(a.DISKFREESPACE_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._BPM_OWS_OS_DATA_STORAGE_GENERIC_WINDOWS_OS_LOGICAL_DISKS_GENERIC_WINDOWS_OS_LOGICAL_DISK_GENERIC_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and DISKFREESPACE_AVG!=-2147483646 and DISKFREESPACE_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
	       <p>
          select a.moinstid, b.devicename,'MEMORYUTILIZATION_AVG' Parameter,'Windows 内存使用率' ParameterDisplay, round(avg(a.MEMORYUTILIZATION_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_WINDOWSWINDOWS_OS_WINDOWS_GENERIC_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID and MEMORYUTILIZATION_AVG!=-2.147483648E7
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'CPUTOTALUTILIZATION_AVG' Parameter,'Windows CPU使用率' ParameterDisplay, round(avg(a.CPUTOTALUTILIZATION_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime,:toTime as totime from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_WINDOWSWINDOWS_OS_WINDOWS_GENERIC_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime and a.moinstid=b.MOINSTID  and CPUTOTALUTILIZATION_AVG!=-2.147483648E7
          group by a.moinstid,b.devicename
         </p>
         <p>
          select a.moinstid, b.devicename,'PATSDK_COMMANDSHELL_LINUX_CPU_USAGE' Parameter,'Linux CPU使用率' ParameterDisplay, round(avg(a.PATSDK_COMMANDSHELL_LINUX_CPU_USAGE_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_LINUX_CMDSHELL_BASE_DR2AL_LINUX_CMDSHELL_CPU_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID and PATSDK_COMMANDSHELL_LINUX_CPU_USAGE_AVG!=-2147483646 and PATSDK_COMMANDSHELL_LINUX_CPU_USAGE_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'PATSDK_COMMANDSHELL_LINUX_FREE_MEMORY_PERCENT' Parameter,'Linux 剩余内存' ParameterDisplay, round(avg(a.PATSDK_COMMANDSHELL_LINUX_FREE_MEMORY_PERCENT_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime
          from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_LINUX_CMDSHELL_BASE_DR2AL_LINUX_CMDSHELL_MEMORY_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID and PATSDK_COMMANDSHELL_LINUX_FREE_MEMORY_PERCENT_AVG!=-2147483646 and PATSDK_COMMANDSHELL_LINUX_FREE_MEMORY_PERCENT_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'PATSDK_COMMANDSHELL_FILESYSTEM_UTILIZATION' Parameter,'Linux 文件系统使用率' ParameterDisplay, round(avg(a.PATSDK_COMMANDSHELL_FILESYSTEM_UTILIZATION_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime
          from dba._BPM_CMDSHELL_DATASTORAGE_CONTAINER_DR2AL_CMDSHELL_FILESYSTEM_CONTAINER_DR2AL_CMDSHELL_FILESYSTEM2_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID and PATSDK_COMMANDSHELL_FILESYSTEM_UTILIZATION_AVG!=-2147483646 and PATSDK_COMMANDSHELL_FILESYSTEM_UTILIZATION_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'PATSDK_COMMANDSHELL_LINUX_SWAP_FREE_SPACE_PERCENT' Parameter,'Linux 交换剩余率' ParameterDisplay, round(avg(a.PATSDK_COMMANDSHELL_LINUX_SWAP_FREE_SPACE_PERCENT_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime
          from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_LINUX_CMDSHELL_BASE_DR2AL_LINUX_CMDSHELL_SWAP_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID and PATSDK_COMMANDSHELL_LINUX_SWAP_FREE_SPACE_PERCENT_AVG!=-2147483646 and PATSDK_COMMANDSHELL_LINUX_SWAP_FREE_SPACE_PERCENT_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'PATSDK_COMMANDSHELL_HPUX_CPU_USAGE' Parameter,'Unix CPU使用率' ParameterDisplay, round(avg(a.PATSDK_COMMANDSHELL_HPUX_CPU_USAGE_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime
          from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_HPUX_CMDSHELL_BASE_DR2AL_HPUX_CMDSHELL_CPU_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID and PATSDK_COMMANDSHELL_HPUX_CPU_USAGE_AVG!=-2147483646 and PATSDK_COMMANDSHELL_HPUX_CPU_USAGE_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'PATSDK_COMMANDSHELL_HPUX_FREE_MEMORY_PERCENT' Parameter,'Unix 剩余内存' ParameterDisplay, round(avg(a.PATSDK_COMMANDSHELL_HPUX_FREE_MEMORY_PERCENT_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime
          from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_HPUX_CMDSHELL_BASE_DR2AL_HPUX_CMDSHELL_MEMORY_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID and PATSDK_COMMANDSHELL_HPUX_FREE_MEMORY_PERCENT_AVG!=-2147483646 and PATSDK_COMMANDSHELL_HPUX_FREE_MEMORY_PERCENT_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'PATSDK_COMMANDSHELL_FILESYSTEM_UTILIZATION_AVG' Parameter,'Unix 文件系统使用率' ParameterDisplay, round(avg(a.PATSDK_COMMANDSHELL_FILESYSTEM_UTILIZATION_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime
          from dba._BPM_CMDSHELL_DATASTORAGE_CONTAINER_DR2AL_CMDSHELL_FILESYSTEM_CONTAINER_DR2AL_CMDSHELL_FILESYSTEM4_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID and PATSDK_COMMANDSHELL_FILESYSTEM_UTILIZATION_AVG!=-2.147483648E7
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'PATSDK_COMMANDSHELL_HPUX_SWAP_FREE_SPACE_PERCENT' Parameter,'Unix 交换剩余率' ParameterDisplay, round(avg(a.PATSDK_COMMANDSHELL_HPUX_SWAP_FREE_SPACE_PERCENT_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime
          from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_HPUX_CMDSHELL_BASE_DR2AL_HPUX_CMDSHELL_SWAP_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID and PATSDK_COMMANDSHELL_HPUX_SWAP_FREE_SPACE_PERCENT_AVG!=-2147483646 and PATSDK_COMMANDSHELL_HPUX_SWAP_FREE_SPACE_PERCENT_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'PATSDK_COMMANDSHELL_AIX_CPU_USAGE' Parameter,'AIX CPU使用率' ParameterDisplay, round(avg(a.PATSDK_COMMANDSHELL_AIX_CPU_USAGE_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime
          from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_AIX_CMDSHELL_BASE_DR2AL_AIX_CMDSHELL_CPU_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID and PATSDK_COMMANDSHELL_AIX_CPU_USAGE_AVG!=-2.147483648E7
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'PATSDK_COMMANDSHELL_AIX_FREE_MEMORY_PERCENT' Parameter,'AIX 剩余内存' ParameterDisplay, round(avg(a.PATSDK_COMMANDSHELL_AIX_FREE_MEMORY_PERCENT_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime
          from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_AIX_CMDSHELL_BASE_DR2AL_AIX_CMDSHELL_MEMORY_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID and PATSDK_COMMANDSHELL_AIX_FREE_MEMORY_PERCENT_AVG!=-2.147483648E7
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'PATSDK_COMMANDSHELL_FILESYSTEM_UTILIZATION' Parameter,'AIX 文件系统使用率' ParameterDisplay, round(avg(a.PATSDK_COMMANDSHELL_FILESYSTEM_UTILIZATION_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime
          from dba._BPM_CMDSHELL_DATASTORAGE_CONTAINER_DR2AL_CMDSHELL_FILESYSTEM_CONTAINER_DR2AL_CMDSHELL_FILESYSTEM_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID and PATSDK_COMMANDSHELL_FILESYSTEM_UTILIZATION_AVG!=-2147483646 and PATSDK_COMMANDSHELL_FILESYSTEM_UTILIZATION_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
        <p>
          select a.moinstid, b.devicename,'PATSDK_COMMANDSHELL_AIX_SWAP_FREE_SPACE_PERCENT' Parameter,'AIX 交换剩余率' ParameterDisplay, round(avg(a.PATSDK_COMMANDSHELL_AIX_SWAP_FREE_SPACE_PERCENT_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime
          from dba._BPM_BMC_PM_EXPRESS_FOR_SERVERS_UNIX_LINUXDR2AL_AIX_CMDSHELL_BASE_DR2AL_AIX_CMDSHELL_SWAP_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime 
          and a.moinstid=b.MOINSTID and PATSDK_COMMANDSHELL_AIX_SWAP_FREE_SPACE_PERCENT_AVG!=-2.147483648E7
          group by a.moinstid,b.devicename
        </p>  
        <p>
          select a.moinstid, b.devicename,'INSTANCESTATUS_AVG' Parameter,'DB2实例状态' ParameterDisplay, round(avg(a.INSTANCESTATUS_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime
          from dba._BPM__PM_EXPRESS_FOR_DATABASES_DB2_UDBCOM_BMC_DRPM4_CONTAINER_COM_BMC_DRPM4_INSTANCE_AVAILABILITY_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID  and INSTANCESTATUS_AVG!=-2147483646 and INSTANCESTATUS_AVG!=-2147483647
          group by a.moinstid,b.devicename
         </p>
		     <p>
          select a.moinstid, b.devicename,'DATABASESTATUS_AVG' Parameter,'DB2数据库状态' ParameterDisplay, round(avg(a.DATABASESTATUS_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime
          from dba._BPM__DRPM4_CONTAINER_COM_BMC_DRPM4_DATABASE_COM_BMC_DRPM4_DATABASEAPP_COM_BMC_DRPM4_AVAILABILITY_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID  and DATABASESTATUS_AVG!=-2147483646 and DATABASESTATUS_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
		    <p>
          select a.moinstid, b.devicename,'INSTANCESTATUS_AVG' Parameter,'ORACLE实例状态' ParameterDisplay, round(avg(a.INSTANCESTATUS_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime
          from dba._BPM_BMC_PM_EXPRESS_FOR_DATABASES_ORACLECOM_BMC_DRPM3_CONTAINER_COM_BMC_DRPM3_AVAILABILITY_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID  and INSTANCESTATUS_AVG!=-2147483646 and INSTANCESTATUS_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
		    <p>
          select a.moinstid, b.devicename,'LISTENERSTATUS_AVG' Parameter,'ORACLE监听状态' ParameterDisplay, round(avg(a.LISTENERSTATUS_AVG),3) as value,getdate() as CreateTime,
          :fromTime as fromtime, :toTime as totime
          from dba._BPM_BMC_PM_EXPRESS_FOR_DATABASES_ORACLECOM_BMC_DRPM3_CONTAINER_COM_BMC_DRPM3_AVAILABILITY_RT_VIEW a,t_device b with(NOLOCK)
          where a.fromtime>=:fromTime and a.totime &lt;=:toTime
          and a.moinstid=b.MOINSTID  and LISTENERSTATUS_AVG!=-2147483646 and LISTENERSTATUS_AVG!=-2147483647
          group by a.moinstid,b.devicename
        </p>
      </load>
      </performance>
    <tmartavai>
      <create>
        CREATE TABLE report.t_tmartAvailability
        (PROJECT_NAME VARCHAR(260),
        MOINSTID INT,
        VALUE INT,
        CreateTime DATETIME,
        FromTime VARCHAR(40),
        Totime VARCHAR(40))
      </create>
      <load>
        insert into report.t_TmartAvailability (PROJECT_NAME,MOINSTID,Value,CreateTime,FROMTIME,TOTIME)
        select a.PROJECT_NAME,a.MOINSTID,round(avg(b.STATS_AVAILABILITY_AVG),3) as value,getdate() as CreateTime,
        :fromTime as fromtime,:toTime as totime
        from dba.TMARTTRANSACTIONS_CFG_VIEW a,dba.TMARTTRANSACTIONS_RT_VIEW b with(NOLOCK)
        where b.fromtime>=:fromTime and b.totime &lt;=:toTime and a.MOINSTID=b.MOINSTID and STATS_AVAILABILITY_AVG  > 0
        group by a.PROJECT_NAME,a.MOINSTID
      </load>
    </tmartavai>
  </sheng>
</root>